stack: Use gtk_widget_measure
authorTimm Bäder <mail@baedert.org>
Sat, 12 Nov 2016 17:58:18 +0000 (18:58 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 12 Nov 2016 19:37:22 +0000 (20:37 +0100)
gtk/gtkstack.c

index b865104eeffe120b4b5d341af27b3459fff1929f..741671818429532f8854cea4818790b723e50ca9 100644 (file)
@@ -2230,11 +2230,14 @@ gtk_stack_allocate (GtkCssGadget        *gadget,
   if (priv->last_visible_child)
     {
       int min, nat;
-      gtk_widget_get_preferred_width (priv->last_visible_child->widget, &min, &nat);
+
+      gtk_widget_measure (priv->last_visible_child->widget, GTK_ORIENTATION_HORIZONTAL,
+                          -1,
+                          &min, &nat, NULL, NULL);
       child_allocation.width = MAX (min, allocation->width);
-      gtk_widget_get_preferred_height_for_width (priv->last_visible_child->widget,
-                                                 child_allocation.width,
-                                                 &min, &nat);
+      gtk_widget_measure (priv->last_visible_child->widget, GTK_ORIENTATION_VERTICAL,
+                          child_allocation.width,
+                          &min, &nat, NULL, NULL);
       child_allocation.height = MAX (min, allocation->height);
 
       gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);